package cqut.wys.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * User数据仓库
 * @author wuyoushan@zbj.com
 * @date 2017/2/20.
 */
public interface UserRepository extends JpaRepository<User,Long>{

    User findByName(String name);

    User findByNameAndAge(String name,Integer age);

    @Query("from Users u where u.name=:name")
    User findUser(@Param("name") String name);

}
